package com.sicau.system.service.impl;

import java.util.List;

import com.sicau.common.annotation.DataScope;
import com.sicau.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sicau.system.mapper.BSupplementMapper;
import com.sicau.system.domain.BSupplement;
import com.sicau.system.service.IBSupplementService;

/**
 * 补测申请Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-03-19
 */
@Service
public class BSupplementServiceImpl implements IBSupplementService 
{
    @Autowired
    private BSupplementMapper bSupplementMapper;

    /**
     * 查询补测申请
     * 
     * @param id 补测申请主键
     * @return 补测申请
     */
    @Override
    public BSupplement selectBSupplementById(Long id)
    {
        return bSupplementMapper.selectBSupplementById(id);
    }

    /**
     * 查询补测申请列表
     * 
     * @param bSupplement 补测申请
     * @return 补测申请
     */
    @Override
    @DataScope(userAlias = "u")
    public List<BSupplement> selectBSupplementList(BSupplement bSupplement)
    {
        return bSupplementMapper.selectBSupplementList(bSupplement);
    }

    /**
     * 新增补测申请
     * 
     * @param bSupplement 补测申请
     * @return 结果
     */
    @Override
    public int insertBSupplement(BSupplement bSupplement)
    {
        bSupplement.setCreateTime(DateUtils.getNowDate());
        return bSupplementMapper.insertBSupplement(bSupplement);
    }

    /**
     * 修改补测申请
     * 
     * @param bSupplement 补测申请
     * @return 结果
     */
    @Override
    public int updateBSupplement(BSupplement bSupplement)
    {
        bSupplement.setUpdateTime(DateUtils.getNowDate());
        return bSupplementMapper.updateBSupplement(bSupplement);
    }

    /**
     * 批量删除补测申请
     * 
     * @param ids 需要删除的补测申请主键
     * @return 结果
     */
    @Override
    public int deleteBSupplementByIds(Long[] ids)
    {
        return bSupplementMapper.deleteBSupplementByIds(ids);
    }

    /**
     * 删除补测申请信息
     * 
     * @param id 补测申请主键
     * @return 结果
     */
    @Override
    public int deleteBSupplementById(Long id)
    {
        return bSupplementMapper.deleteBSupplementById(id);
    }
}
